<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:c="http://java.sun.com/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j" >

  <ui:composition template="/template/template.xhtml" >
    <ui:define name="title">Trajets</ui:define>

    <ui:define name="body">
    
		<c:if test="${!empty beansRoute.messageErr}">
			<div><h:outputText value="#{beansRoute.messageErr}" styleClass="msg error" /></div>
		</c:if>

      <ul id="rides">
        <a4j:repeat value="#{beansRoute.route_list}" var="route">       
        <li class="ride"> 
          <a4j:form ajaxSubmit="true">
          <a4j:region id="list" >       
            <a4j:commandLink action="#{beansRoute.toShow}">
              <f:param name="route_id" value="#{route.id}" />
              <div class="from"><span>De :</span>#{route.position_beginObj.address}</div>
              <div class="to"><span>À :</span>#{route.position_endObj.address}</div>
              <div class="countdown">#{route.delay_from_now_text}</div>
              <div class="matching">#{route.seatDots}</div>
            </a4j:commandLink>
          </a4j:region>
          </a4j:form>               
        </li>       
        </a4j:repeat>
      </ul>
      <c:if test="${empty beansRoute.route_list}">
      	<p class="minimsg">☹ Ooops, il n'y a pas encore de trajet correspondant à votre recherche.</p>
      	<h:form><h:commandButton value="Retour" styleClass="large" action="retour" /></h:form>
      </c:if>
    </ui:define>
  </ui:composition>
</html>
